package com.example.mall.goods.api.service;


import com.example.mall.goods.api.entity.MallGoods;
import com.example.mall.util.PageQueryUtil;
import com.example.mall.util.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "mall-goods-core")
public interface MallGoodsService {

    @PostMapping("/goods/getMallGoodsPage")
    PageResult getMallGoodsPage(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/goods/saveMallGoods")
    String saveMallGoods(@RequestBody MallGoods goods);

    @PostMapping("/goods/batchSaveMallGoods")
    void batchSaveMallGoods(@RequestBody List<MallGoods> mallGoodsList);

    @PostMapping("/goods/updateMallGoods")
    String updateMallGoods(@RequestBody MallGoods goods);

    @PostMapping("/goods/getMallGoodsById")
    MallGoods getMallGoodsById(@RequestParam("id") Long id);

    @PostMapping("/goods/getShopUserNameByGoodsId")
    String getShopUserNickNameByShopUserId(@RequestParam("id") Long id);

    @PostMapping("/goods/batchUpdateSellStatus")
    Boolean batchUpdateSellStatus(@RequestParam("ids") Long[] ids,
                                  @RequestParam("sellStatus") int sellStatus);

    @PostMapping("/goods/searchMallGoods")
    PageResult searchMallGoods(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/goods/showShopGoods")
    PageResult showShopGoods(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/goods/selectByPrimaryKeys")
    List<MallGoods> selectByPrimaryKeys(@RequestBody List<Long> goodsIds);
}
